package cn.sofwin.day0107.homework;

import java.util.Scanner;

public class Digit {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个整数：");
        int number = sc.nextInt();
        int count = judge(number);
        System.out.println("位数为" + count);
    }

    static int judge(int n){
        int c = 0;
        while(n>0)
        {
            n /=10;
            c++;
        }
        return c;
    }

}
